package user;

import Operation.*;

import java.util.Scanner;

//管理员
public class Admin extends User{
    public Admin(){
        this.operations = new IOperation[]{
          new ExitOperation(),
          new DisplayOperation(),
          new FindOperation(),
          new AddOperation(),
          new DelOperation()
        };
    }
//    当非抽象类继承抽象类的时候，子类是需要重写父类的抽象方法，对其具体实现
    @Override
    public int menu() {
        // 打印管理员的菜单
        System.out.println("===============================================");
        System.out.println("欢迎宁,"+this.getUserName()+"宁是管理员");//继续自父类的get方法,this表示带当前对象的引用
        System.out.println("1.查看书籍列表");
        System.out.println("2.查找指定书籍");
        System.out.println("3.新增书籍");
        System.out.println("4.删除书籍");
        System.out.println("0.退出系统");
        System.out.println("===============================================");
        System.out.println("请选择:>");
        Scanner scanner = new Scanner(System.in);
        int choice = scanner.nextInt();
        return choice;
    }
}
